package com.dy.system.service.impl;

import java.util.List;
import com.dy.common.utils.DateUtils;
import com.dy.system.domain.FreshWarningMsgTypeDetail;
import com.dy.system.mapper.FreshWarningMsgTypeDetailMapper;
import com.dy.system.service.IFreshWarningMsgTypeDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 告警消息详情Service业务层处理
 *
 * @author ruoyi
 * @date 2022-09-15
 */
@Service
public class FreshWarningMsgTypeDetailServiceImpl implements IFreshWarningMsgTypeDetailService {
    @Autowired
    private FreshWarningMsgTypeDetailMapper freshWarningMsgTypeDetailMapper;

    /**
     * 查询告警消息详情
     *
     * @param id 告警消息详情主键
     * @return 告警消息详情
     */
    @Override
    public FreshWarningMsgTypeDetail selectFreshWarningMsgTypeDetailById(Long id) {
        return freshWarningMsgTypeDetailMapper.selectFreshWarningMsgTypeDetailById(id);
    }

    /**
     * 查询告警消息详情列表
     *
     * @param freshWarningMsgTypeDetail 告警消息详情
     * @return 告警消息详情
     */
    @Override
    public List<FreshWarningMsgTypeDetail> selectFreshWarningMsgTypeDetailList(FreshWarningMsgTypeDetail freshWarningMsgTypeDetail) {
        return freshWarningMsgTypeDetailMapper.selectFreshWarningMsgTypeDetailList(freshWarningMsgTypeDetail);
    }

    /**
     * 新增告警消息详情
     *
     * @param freshWarningMsgTypeDetail 告警消息详情
     * @return 结果
     */
    @Override
    public int insertFreshWarningMsgTypeDetail(FreshWarningMsgTypeDetail freshWarningMsgTypeDetail) {
        freshWarningMsgTypeDetail.setCreateTime(DateUtils.getNowDate());
        return freshWarningMsgTypeDetailMapper.insertFreshWarningMsgTypeDetail(freshWarningMsgTypeDetail);
    }

    /**
     * 修改告警消息详情
     *
     * @param freshWarningMsgTypeDetail 告警消息详情
     * @return 结果
     */
    @Override
    public int updateFreshWarningMsgTypeDetail(FreshWarningMsgTypeDetail freshWarningMsgTypeDetail) {
        return freshWarningMsgTypeDetailMapper.updateFreshWarningMsgTypeDetail(freshWarningMsgTypeDetail);
    }

    /**
     * 批量删除告警消息详情
     *
     * @param ids 需要删除的告警消息详情主键
     * @return 结果
     */
    @Override
    public int deleteFreshWarningMsgTypeDetailByIds(Long[] ids) {
        return freshWarningMsgTypeDetailMapper.deleteFreshWarningMsgTypeDetailByIds(ids);
    }

    /**
     * 删除告警消息详情信息
     *
     * @param id 告警消息详情主键
     * @return 结果
     */
    @Override
    public int deleteFreshWarningMsgTypeDetailById(Long id)
    {
        return freshWarningMsgTypeDetailMapper.deleteFreshWarningMsgTypeDetailById(id);
    }

    @Override
    public FreshWarningMsgTypeDetail selectWarningTypeByType(String networkStatus) {
        return freshWarningMsgTypeDetailMapper.selectWarningTypeByType(networkStatus);
    }
}
